<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="u" uri="/iuie-tag"%>
<%@ taglib prefix="sys" uri="/sys-tag" %>
<%@ taglib prefix="lui" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新增表实例</title>
</head>
<lui:context/>
<u:View basePath="/res-datum/development" userJS="addTable" userCSS="addTable" delayLoadJs="false">
<body>
<lui:dialogBody>
	<form id="editTableFrm" class="m-cust">
		<div class="form-group row m-narrow">
		    <div class="col-sm-12 col-md-12 col-xs-12">
		    	<div class="col-sm-3 col-md-3 col-xs-3">
				    <label for="projectId" class="m-label required">项目：</label>
				</div>
				<div class="col-sm-9 col-md-9 col-xs-9">
					<lui:ajax url="${ctx }/datum/devProj/find/all" id="findAllProjectAjax" autoSend="true" async="false"
						respDataKey="projects"/>
				    <lui:dropList id="projectId" name="projectId" textDefine="cnProjectName" valueDefine="id" 
						className="form-control m-input" showSelectAll="true" dropValues="projects" handleRowData="AddTablePage.handleRowData"
						showSelectName="请选择"/>
				</div>
		    </div>
		</div>
		<div class="form-group row m-narrow">
			<div class="col-sm-12 col-md-12 col-xs-12">
			    <div class="col-sm-3 col-md-3 col-xs-3">
				    <label for="enTableName" class="m-label required">表英文名：</label>
				</div>
				<div class="col-sm-9 col-md-9 col-xs-9">
				    <input name="enTableName" id="enTableName" type="text" class="form-control m-input" data-validate='true' data-not-empty='true' 
	                    data-empty-text="表英文名不能为空" maxlength="32" data-0-regexp="^[a-zA-Z_][a-zA-Z0-9_]{1,32}$" 
	                    data-0-error-text="格式不合法<br>格式：以英文26个字母开头，大小写随意，内容仅能为26个英文字母或下划线" data-prompt="dialog">
				</div>
			</div>
		</div>
		<div class="form-group row m-narrow">
			<div class="col-sm-12 col-md-12 col-xs-12">
			    <div class="col-sm-3 col-md-3 col-xs-3">
				    <label for="cnTableName" class="m-label required">表中文名：</label>
				</div>
				<div class="col-sm-9 col-md-9 col-xs-9">
				    <input name="cnTableName" id="cnTableName" type="text" class="form-control m-input" data-validate='true' data-not-empty='true'
				    	data-empty-text="表中文名不能为空" maxlength="60">
				</div>
			</div>
		</div>
		<div class="form-group row m-narrow">
			<div class="col-sm-12 col-md-12 col-xs-12">
			    <div class="col-sm-3 col-md-3 col-xs-3">
				    <label for="className" class="m-label">类名：</label>
				</div>
				<div class="col-sm-9 col-md-9 col-xs-9">
				    <input name="className" id="className" type="text" class="form-control m-input" data-validate='true' 
				    	data-0-regexp="^[a-zA-Z_][a-zA-Z0-9_]{1,64}$" data-0-error-text="格式不合法<br>格式：以英文26个字母开头，大小写随意，内容仅能为26个英文字母或下划线"
				    	maxlength="60">
				</div>
			</div>
		</div>
		<div class="form-group row m-narrow">
			<div class="col-sm-12 col-md-12 col-xs-12">
			    <div class="col-sm-3 col-md-3 col-xs-3">
				    <label for="remark" class="m-label">注释：</label>
			    </div>
			    <div class="col-sm-9 col-md-9 col-xs-9">
				    <textarea name="remark" id="remark" class="form-control m-input" rows="2" maxlength="200"></textarea>
			    </div>
		    </div>
		</div>
		<c:if test="${not empty requestScope.tableId }">
			<div class="form-group row m-narrow">
				<div class="col-sm-12 col-md-12 col-xs-12">
				    <div class="col-sm-3 col-md-3 col-xs-3">
					    <label for="updateRemark" class="m-label required">修改备注：</label>
				    </div>
				    <div class="col-sm-9 col-md-9 col-xs-9">
					    <textarea name="updateRemark" id="updateRemark" class="form-control m-input" rows="2" maxlength="200" data-validate="true"
					    	data-not-empty="true" data-empty-text="修改备注不能为空" data-prompt="messager"></textarea>
				    </div>
			    </div>
			</div>
		</c:if>
		<input hidden="hidden" name="id">
		<c:if test="${not empty requestScope.tableId }">
			<lui:ajax id="findTableByIdAjax" url="${ctx }/datum/development/find/id/${requestScope.tableId }" autoSend="true"
				onSuccess="AddTablePage.onFindTableSucc"/>
		</c:if>
		<lui:ajax id="saveUserTableAjax" url="${ctx }/datum/development/save/table" onSuccess="AddTablePage.saveSucc" formQuery="#editTableFrm"
			formSubmit="true"/>
	</form>
</lui:dialogBody>
<lui:dialogFooter>
      <button class="btn btn-primary m-btn" type="button" onclick="AddTablePage.save()">保存</button>
      <button class="btn btn-default m-btn" type="button" data-dismiss="dialog-box">关闭</button>
</lui:dialogFooter>
</body>
</u:View>
</html>